﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
namespace WebApi.Models
{
    public class TicketModel
    {
        public int tid { get; set; }
        public int hdId { get; set; }
        public string ticketName = string.Empty;
        public double fare { get; set; }
        public string endTime = string.Empty;
        public int allVotes { get; set; }

        public static TicketModel GetActivity(DataRow dr)
        {
            TicketModel model = new TicketModel();
            model.tid = Convert.ToInt32(dr["tid"]);
            model.hdId = Convert.ToInt32(dr["hdId"]);
            model.ticketName = Convert.ToString(dr["ticketName"]);
            model.fare = Convert.ToDouble(dr["fare"]);
            model.endTime = Convert.ToString(dr["endTime"]);
            model.allVotes = Convert.ToInt32(dr["allVotes"]);
            return model;
        }
    }
}